#include <iostream>
#include <fstream>

std::ifstream fin("bfdiff.in");

typedef long long value_type;

int main()
{
	value_type x1, x2, p, k;
	fin >> x1 >> x2 >> p >> k;
	std::string s;
	std::cin >> s;
	std::cout << s << '\n';
	if (s == "YES") {
		value_type p1, n1, p2, n2;
		std::cin >> p1 >> n1 >> p2 >> n2;
		std::cout << p1 << ' '  << n1 << ' ' << p2 << ' ' << n2 << '\n';
		if (p1 < 0 || n1 < 0 || p2 < 0 || n2 < 0)
			std::cout << "be negative!\n";
		if (p1 + n1 + p2 + n2 != k)
			std::cout << "not equal to k\n";
		if ((p1 - n1) * x1 + (p2 - n2) * x2 != p)
			std::cout << "not vaild\n";
	}
}

